<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加内容</title>
<load href="__PUBLIC__/css/bootstrap.min.css" />
<import type='css' file="css.main" />
<load href="__PUBLIC__/js/jquery-1.9.1.min.js" />
<load href="__PUBLIC__/js/jquery-ui.min.js" />
<import type='js' file="js.main" />
<import type='js' file="js.setshowflag" />
<script type="text/javascript">
$(function(){
	
	$("#floatBackground").click(function(){
		$(this).fadeOut();	
	})
	function getTypestr(strpath){
		$.get(strpath, function(result){
			$("select[name='menuid']").html(result);
		});
	}
	var wymaselect = $("select[name='typeid']");
	function showsubmenu(val){
		var typeID = val;
		if(typeID>0){
			getTypestr("__URL__/menuoption/rootid/"+typeID);
		}	
	}
	showsubmenu(wymaselect.val());
	wymaselect.change(function(){
		var v = $(this).val();
		showsubmenu(v);
	})
	window.onload = function(){ 
		var menuid = $("select[name='menuid']");
		mtype(menuid.val());
		
	}
	menuid.change(function(){
		var v = $(this).val();
		mtype(v);
	})
	function mtype(val){
		var id = val;
		if(id>0){
			getMenuType("__URL__/showmenutype/smid/"+id);
		}	
	}
	function getMenuType(strpath){
		$.get(strpath, function(result){
			/*result(1=>视频,2=>咨询,3=>频道,4=>商城)*/
			$("select[name='resourcetype'] option").each(function(index, element) {
                if($(this).val()==result){
					$(this).attr("selected","selected").siblings().removeAttr("selected");
					otherinfotabs(result);	
				}
            });
		});
	}
	
	window.onload = function(){ 
		var v = $("select[name='resourcetype']").val();
		otherinfotabs(v);
	}
	function otherinfotabs(v){
		$("div.tabs span.infos").each(function(index, element) {
			if($(this).attr('typeV')==v){
				$(this).show().siblings().hide();
				$("li.oline").show();
				return false;
			}else{
				$("li.oline").hide();
				$(this).hide();
			}
		});
	}
})
</script>
</head>

<body id="body">
<div class="main-frame">
	<div class="position">华人码 > 添加文档</div>
	<!-- 图片资源开始 -->
	<div class="floatBackground" id="floatBackground" style="display: none;">
		<div class="bounced">
		<label class="closeImgResurces">X</label>
		<iframe id="imgResourcesiframe" src="{:rtrim(U('Upload/index'),'.html')}" width="750" height="465" frameborder="0" scrolling="auto"></iframe>
		</div>
	</div>
	<!-- 图片资源结束 -->
	<div class="addobject">
		<div class="obj-form">
			<form name="form1" id="form1" action="{:U('Article/add')}" method="post" class="form-inline">
				<ul>
					<li>
						<label class="fl tle">文章标题：</label>
						<span class="fl cnt">
						<input name="title" class="form-control" placeholder="文章标题" style="width: 450px;"><em>*</em>
						</span>
					</li>
					<li>
						<label class="fl tle">简略标题：</label>
						<span class="fl cnt">
						<input name="shorttitle" class="form-control" placeholder="简略标题" style="width: 200px;">
						</span>
					</li>
					<li>
						<label class="fl tle">缩略图：</label>
						<span class="fl cnt"><input name="thumbimg" id="thumbimg" class="form-control" placeholder="缩略图" style="width: 450px;"><a class="browse" f='thumbimg'>浏览···</a></span>
					</li>
					<li>
						<label class="fl tle">扩展属性：</label>
						<span class="fl cnt">
							<input type="checkbox" value="t" name="extendattr[]" class="extendedattr">特荐
							<input type="checkbox" value="c" name="extendattr[]" class="extendedattr">推荐
							<input type="checkbox" value="j" name="extendattr[]" class="extendedattr specifiedjump">跳转
							<input type="checkbox" value="e" name="extendattr[]" class="extendedattr">独家
							<input type="checkbox" value="h" name="extendattr[]" class="extendedattr">热门
							<input type="checkbox" value="f" name="extendattr[]" class="extendedattr foucsimg">焦点
							<input type="checkbox" value="l" name="extendattr[]" class="extendedattr">左
							<input type="checkbox" value="r" name="extendattr[]" class="extendedattr">右
							<input type="checkbox" value="u" name="extendattr[]" class="extendedattr">上
							<input type="checkbox" value="d" name="extendattr[]" class="extendedattr">下
						</span>
					</li>
					<li class="clickjump">
						<label class="fl tle">跳转网址：</label>
						<span class="fl cnt">
						<input name="jumplink" class="form-control" placeholder="跳转网址" style="width: 450px;">
						</span>
					</li>
					<li class="fousimg">
						<label class="fl tle">焦点图：</label>
						<span class="fl cnt"><input name="extendimg" id="extendimg" class="form-control" placeholder="扩展图" style="width: 450px;"><a class="browse" f='extendimg'>浏览···</a></span>
					</li>
					<li>
						<label class="fl tle">菜单选择：</label>
				    	<span class="fl cnt">
					    	<select name="typeid" class="template form-control">
					    		<volist name='wymaselect' id='v'>
					    		<option value="{$v.id}">{$v.typename}</option>
					    		</volist>
					    	</select>
					    	<select name="menuid" class="template form-control"></select>
                            &nbsp;&nbsp;<span style="color:#999;"> ==> &nbsp;</span>
					    	<select name="resourcetype" class="template form-control" disabled="disabled">{:W('Menutype/showtype')}</select>
				    	</span>
					</li>
					<li>
						<label class="fl tle">优先级：</label>
						<span class="fl cnt"><input name="weight" class="txtlength200" style="width: 100px;" placeholder="1"> <font style="color: #999;">（越小越靠前）</font>&nbsp;&nbsp;&nbsp;&nbsp;
						类型：{:W('Menutype/resourcetype',array('name'=>'rtype',$arraytype))}</span>
					</li>

					<li style="display: none">
						<label class="fl tle">音频地址：</label>
						<span class="fl cnt">
							<textarea name="audiopath" class="form-control" placeholder="音频地址" style="width: 760px; height:50px;"></textarea> <font style="color: #999;"><a href="http://vf.hrtv.cn/videocode/" target="_blank">点击这里</a> 获取音乐地址</font>
						</span>
					</li>

                    <li class="oline"><span class="dividerline"></span></li>
					<li>
						<label class="fl tle">视频地址：</label>
                        <span class="fl cnt"><textarea name="videopath" class="form-control" placeholder="视频地址" style="width: 900px; height:60px;"></textarea></span>
					</li>
					<li style="display: none;">
						<label class="fl tle">视频评分：</label>
                        <span class="fl cnt"><input name="filmgrade" class="txtlength200" style="width: 100px;" placeholder="8.8"> &nbsp;&nbsp;&nbsp;&nbsp;
                        影视集数：<input name="filmnum" class="txtlength200" style="width: 100px;" placeholder="1"></span>
					</li>
                    <div class="otherparmeter">
                        <div class="tabs">
                            <!--商品-->
                            <span class="infos" typeV='4'>
                                <li>
                                    <label class="fl tle">促销短语：</label>
                                    <span class="fl cnt">
                                    <input name="salesphrase" class="form-control" placeholder="比如：洗护发产品电脑端首页置顶通栏爆品直降，部分产品199-100" style="width: 450px;">
                                    </span>
                                </li>
                                <li>
                                    <label class="fl tle">商品价格：</label>
                                    <span class="fl cnt"><input name="shopprice" class="txtlength200" style="width: 100px;" placeholder="￥"><font style="color:#666;">（币种：人民币）</font></span>
                                </li>
                            </span>
                        </div>
                    </div>

					<li><span class="dividerline"></span></li>

				    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/UEditor/ueditor.config.js"></script>
				    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/UEditor/ueditor.all.min.js"> </script>
				    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/UEditor/lang/zh-cn/zh-cn.js"></script>
					<li>
						<label class="fl tle">详情内容：</label>
						<span class="fl cnt">
							<textarea name="content" id="editor" style="width: 900px; height:350px; overflow: hidden;"></textarea>
							<script>var ue = UE.getEditor('editor');</script>
						</span>
					</li>

					<li><span class="dividerline"></span></li>

					<li>
						<label class="fl tle">内容状态：</label>
						<span class="fl cnt">
							<input class="radio" type="radio" name="state" value="1" checked="checked"> 开启
							<input class="radio" type="radio" name="state" value="0" style="margin-left:10px;"> 关闭
							<font style="color: #999; margin-right:15px;">（默认开启）</font>
                             	发布人：<input name="issuer" class="txtlength200" style="width: 100px; margin-right:15px;" placeholder="{$Think.session.userinfo.username}" value='{$Think.session.userinfo.username}' readonly="readonly">
                             	发布日期：<input name="pubdate" class="txtlength200" style="width: 160px;" placeholder="发布日期" value="{:date('Y-m-d H:i:m')}">
						</span>
					</li>
					<li class="error" style="display:none;">
						<label class="fl tle">&nbsp;</label>
						<span class="fl cnt"><font>错误：此处显示错误提示</font></span>
					</li>
					<li class="submit">
						<label class="fl tle">&nbsp;</label>
						<span class="fl cnt"><input type="submit" value="发 布" class="submitbtn" /> <a href="{:U('articlelist')}">取消</a></span>
					</li>
				</ul>
			</form>
		</div>
		<div class="obj-previewimg">
			<div class="instructions">
				<b>备注说明：</b><br>
				1、带有红色  “ * ” 项必填<br>
				2、发布资源时请选择对应的“资源类型”<br>
				3、填写跳转网址请填写完整，如：http://*<br>
				4、选择自定属性中的焦点后，所上传图片必 须是长矩形图
			</div>
		</div>
	</div>

</div>
</body>
</html>
